package controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/5/20 10:20
 * Version:1.0-SNAPSHOT
 * Description:
 */
@Controller
@RequestMapping(value = "/hello")
public class HelloAnnotationController {

//    @RequestMapping("/f1")
    @RequestMapping
    public ModelAndView f1(){
        ModelAndView mav = new ModelAndView();
        mav.addObject("msg","<span style='color:red;'>Hello Annotation</span>");
        mav.setViewName("hello");
        return mav;
    }

    @RequestMapping({"/f2","/test2"})
    public ModelAndView f2(){
        ModelAndView mav = new ModelAndView();
        mav.addObject("msg","<span style='color:red;'>Hello Annotation</span>");
        mav.setViewName("hello");
        return mav;
    }

}
